package org.txazo.blog.commons.parse.base;

import java.io.BufferedWriter;
import java.io.IOException;

import org.txazo.blog.commons.io.base.Reader;

/**
 * Parser
 * 
 * @author Tu XiaoZhou
 * @since 2013-08-29
 * 
 */
public abstract class AbstractParser implements Parser {

	protected Reader reader = null;
	protected BufferedWriter writer = null;

	public AbstractParser(Reader reader) {
		this.reader = reader;
	}

	@Override
	public void parse(BufferedWriter writer) throws IOException {
		this.writer = writer;

		parse();
	}

	public abstract void parse() throws IOException;

	@Override
	public void close() {
		reader.close();
	}

}
